package Day08;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请录入工人姓名");
        String name=sc.nextLine();
        System.out.println("请录入工人工龄");
        int year=sc.nextInt();
        Worker wk=new Worker(name,year);
        System.out.println("该工人对象的属性信息如下:");
        System.out.println("姓名："+wk.getName());
        System.out.println("工龄："+wk.getYear());
    }
}
